const { defineConfig } = require('@vue/cli-service')
const mock =require('mockjs')

module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave:false,


  devServer:{
    onAfterSetupMiddleware(server){
      server.app.get('/list',(req,res)=>{

        //使用mockjs模拟数据
        let data = mock.mock({
          'list|10':[{
            id:"id",
            img:'@image(100x100,@color)',
            user:'@cname',
            "count|1-100":0,
          }]
        })

        //返回前端数据
        res.json(data.list)
      })
    }
  }

})
